<template>
	<view>
		<u-tabbar :value="numb" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" activeColor="#171717" inactiveColor="#171717">
			<u-tabbar-item text="首页" @click="click1(0)">
				<image src="@/static/tabbar/0.png" slot="active-icon" mode=""></image>
				<image src="@/static/tabbar/01.png" slot="inactive-icon" mode=""></image>
			</u-tabbar-item>
			<u-tabbar-item text="服务点" @click="click1(1)">
				<image src="@/static/tabbar/1.png" slot="active-icon" mode=""></image>
				<image src="@/static/tabbar/02.png" slot="inactive-icon" mode=""></image>
			</u-tabbar-item>

			<u-tabbar-item text="VIP" @click="click1(2)">
				<image src="@/static/tabbar/2.png" slot="active-icon" mode=""></image>
				<image src="@/static/tabbar/03.png" slot="inactive-icon" mode=""></image>
			</u-tabbar-item>
			<u-tabbar-item text="我的" @click="click1(3)">
				<image src="@/static/tabbar/3.png" slot="active-icon" mode=""></image>
				<image src="@/static/tabbar/04.png" slot="inactive-icon" mode=""></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		name: "tabbar",
		data() {
			return {

			}
		},
		props: {
			numb: {
				type: Number,
				default: 0
			}
		},
		methods: {
			goTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			click1(e) {
				if (e == this.numb) {
					return
				}
				if (e == 0) {
					uni.redirectTo({
						url: '/pages/home/home'
					})
				} else if (e == 1) {
					uni.redirectTo({
						url: '/pages/service-store/service-store'
					})
				} else if (e == 2) {
					uni.redirectTo({
						url: '/pages/vip-center/vip-center'
					})
				} else if (e == 3) {
					uni.redirectTo({
						url: '/pages/mine/mine'
					})
				}
			}
		},

	}
</script>

<style scoped lang="scss">
	image {
		width: 39rpx;
		height: 39rpx;
	}
</style>